package com.ruoyi.config;

import com.ruoyi.service.IBookService;
import com.ruoyi.service.IMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component
public class SendEmailTask {

    @Autowired
    private IMessageService iMessageService;

    @Resource
    private IBookService bookService;

    @Scheduled(cron = "0 0 8 * * ?")
    public void sendEmail(){
        iMessageService.sendCallMessage();
        iMessageService.sendFineMessage();

    }

//
//   @Scheduled(cron = "* * * * * *")
    @Scheduled(cron = "0 0 0 * * ?")
    public void getBookNum (){
        bookService.getBookNum();

    }


}
